<template>
  <div>
    <MyProduct v-for="item in list" :key="item.id" :title="item.proname" :price="item.proprice" :id="item.id" @kan="kanfn"/>
  </div>
</template>

<script>
import MyProduct from "./components/MyProduct.vue"
export default {
  components:{MyProduct},
  data(){
    return {
      list: [
        { id: 1, proname: '超级无敌椰子鸡儿', proprice: 69 },
        { id: 2, proname: '超级无敌棒棒鸡儿', proprice: 59 },
        { id: 3, proname: '超级无敌鸡你太美', proprice: 49 }
      ]
    }
  },
  methods:{
    kanfn(id) {
      const produt = this.list.find(item => item.id = id)
      produt.proprice -= 2
    }
  }
}
</script>

<style>

</style>